# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=py3-construct
pkgver=2.10.70
pkgrel=0
pkgdesc="A powerful declarative symmetric parser/builder for binary data"
url="https://construct.readthedocs.io/en/latest/"
arch="noarch"
license="MIT"
depends="python3"
makedepends="
	python3-dev
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
checkdepends="
	py3-arrow
	py3-cloudpickle
	py3-cryptography
	py3-lz4
	py3-numpy
	py3-pytest-benchmark
	py3-ruamel.yaml
	"
subpackages="$pkgname-pyc"
source="https://github.com/construct/construct/archive/v$pkgver/py3-construct-$pkgver.tar.gz"
builddir="$srcdir/construct-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
1c4fe99d36266bf68f4876fdaea5b7cbbb2ea202b73cf4b54f92b443cd753200aec52a15ff97001c9e040b3c16ecc8dd444bbac26f7860100087e430beab1f81  py3-construct-2.10.70.tar.gz
"
